import React, { useState } from 'react';
import ReactDOM from 'react-dom';
function Child1(props) {
  // let [name, setName] = useState("珠峰")
  let [sex, setSex] = useState("男")
  return <h1>{props.name} {sex}</h1>
}
function Child2(props) {
  // let [name, setName] = useState("珠峰")
  let [age, setage] = useState(12)
  return <h1>{props.name} {age}</h1>
}
class App extends React.Component {
  state = {
    name: "珠峰"
  }
  render() {
    return <div className=''>
      <Child1 name={this.state.name} />
      <Child2 name={this.state.name} />
    </div>;
  }
}

ReactDOM.render(<App />, document.getElementById('root'))